package com.whut.community.domain.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("post")
public class Post {
    /**
     * 帖子 id
     */
    @TableId(value = "post_id", type = IdType.ASSIGN_ID)
    private Long postId;

    /**
     * 用户 id，帖子的作者
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 帖子标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 帖子内容，目前是纯文本
     */
    @TableField(value = "content")
    private String content;

    /**
     * 帖子分类
     */
    @TableField(value = "category")
    private String category;

    /**
     * 创建时间
     */
    @TableField(value = "create_time",  fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time",  fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 逻辑删除标志：0-正常，1-逻辑删除
     */
    @TableField(value = "is_deleted")
    @TableLogic(value = "0", delval = "1")
    private Integer isDeleted;
}
